<template>
    <div class="oneMax" ref="oneMax">
        <publiMin :title="'新鲜好物'" :biao="'新鲜出炉 品质靠谱'">
            <template>
                查看全部>
            </template>
            <template v-slot:qq>
                <div class="eeeeeee">
                    <div class="public_di_bao" v-for="item in shu" :key="item.id">
                        <div class="public_di_temp">
                            <img src="" alt="" v-lazy="item.picture">
                            <div class="public_di_wen">
                                <p>{{ item.name }}</p>
                                <p>￥{{ item.price }}</p>
                            </div>
                        </div>
                    </div>
                </div>
            </template>
        </publiMin>
    </div>
</template>
<script>
import publiMin from "@/components/bottom/publiMin"
import { getnew } from "@/utils/api/homeapi"
import { lazyload } from '@/utils/content'
export default {
    components: { publiMin },
    data() {
        return {
            shu: []
        }
    },
    mounted() {
        // this.setGetnew()
        // 导入原生api 来观察我们的dom元素
        lazyload(this.$refs.oneMax,this.setGetnew)
    },
    methods: {
        async setGetnew() {
            let data = await getnew()
            this.shu = data.data.result
            // console.log(this.shu);
        }
    }
}
</script>
<style lang="scss" scoped>
.eeeeeee {
    width: 1200px;
    height: 426px;
    // background: green;
    display: flex;
    justify-content: space-between;
    // align-items: center;


    .public_di_bao {
        width: 295px;
        height: 406px;
        display: flex;
        justify-content: space-between;
        // align-items: center;

        .public_di_temp {
            width: 100%;
            height: 306px;

            img {
                width: 100%;
                height: 100%;
            }

            .public_di_wen {
                width: 100%;
                height: 100px;
                display: flex;
                align-content: center;
                flex-wrap: wrap;
                background: #f0f9f4;
                p {
                    height: 50%;
                    width: 306px;
                    margin-top: 10px;
                    font-size: 18px;
                }
                p:nth-child(2){
                    color: red;
                    font-size: 22px;
                }
            }
        }


    }
}
</style>